package org.web.demo.listener;

import lombok.extern.slf4j.Slf4j;

import javax.servlet.annotation.WebListener;
import javax.servlet.http.HttpSessionAttributeListener;
import javax.servlet.http.HttpSessionBindingEvent;

/**
 * @author yexi
 */
@WebListener
@Slf4j
public class CustomHttpSessionAttributeListener implements HttpSessionAttributeListener {
    @Override
    public void attributeAdded(HttpSessionBindingEvent se) {
        log.info("任何一个Session对象中添加了数据");
    }

    @Override
    public void attributeRemoved(HttpSessionBindingEvent se) {
        log.info("任何一个Session对象中移除了数据");
    }

    @Override
    public void attributeReplaced(HttpSessionBindingEvent se) {
        log.info("任何一个Session对象中修改了数据");
    }
}
